package operation.modules.operation.controller;

import operation.modules.operation.service.AndroidService;
import operation.util.ReqResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * android代码生成Controller
 */
@RestController
@RequestMapping("api/android")
public class AndroidController {
    @Autowired
    private AndroidService androidService;

    /**
     * 生成代码
     * @return
     */
    @RequestMapping("/make-code")
    public ReqResult list(@RequestBody Map<String, Object> params) {
        String res = androidService.makeCode(params);
        System.out.println(res);
        return ReqResult.ok().put("result", res);
    }
}
